package com.huawei.appgallery.forum.section.buoy.action;

import android.app.Activity;
import android.content.Context;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.IOpenViewAction;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.RemoteBuoyAction;
import com.huawei.appgallery.forum.posts.api.IPostDetailProtocol;
import com.huawei.appgallery.forum.posts.api.IPostDetailResult;
import com.huawei.secure.android.common.intent.SafeIntent;
import o.dys.a;
import o.fho;
import o.fiu;
import o.fjb;
import o.fjc;

public class OpenPostCommentAction extends IOpenViewAction {
    public static final String ACTION = "com.huawei.gamebox.ACTION_OPEN_POST_COMMENT";
    private static final String TAG = "OpenPostCommentAction";
    private static fjc<IPostDetailResult> postCommentCallBack;

    public OpenPostCommentAction(a aVar, SafeIntent safeIntent) {
        super(aVar, safeIntent);
    }

    public void onAction() {
        dispatchOpenForumMessage();
    }

    private void dispatchOpenForumMessage() {
        if (this.callback instanceof Activity) {
            fjb ˎ = fho.ˏ().ˋ("Posts").ˎ("post.detail.activity");
            IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) ˎ.ˊ();
            iPostDetailProtocol.setSourceType(this.intent.getIntExtra("source_type", 1));
            iPostDetailProtocol.setUri(this.intent.getStringExtra(RemoteBuoyAction.REMOTE_BUOY_URI).replace("buoy_", ""));
            iPostDetailProtocol.setNeedComment(this.intent.getBooleanExtra("need_comment", false));
            iPostDetailProtocol.setPostStatus(this.intent.getIntExtra("post_status", 1));
            iPostDetailProtocol.setDomainId(this.intent.getStringExtra("domain_id"));
            fiu.ˊ().ॱ((Context) this.callback, ˎ, postCommentCallBack);
        }
    }

    public static synchronized void registerCall(fjc<IPostDetailResult> o_fjc_com_huawei_appgallery_forum_posts_api_IPostDetailResult) {
        synchronized (OpenPostCommentAction.class) {
            postCommentCallBack = o_fjc_com_huawei_appgallery_forum_posts_api_IPostDetailResult;
        }
    }
}
